This is a simple port of the regular expression package as developed by
Henry Spencer at the University of Toronto. All source code comments have been retained and the only changes made in the source were those needed to compile and execute successfully under THINK C 4.02.
As a reference point, the port was done on a Mac SE with 4MB RAM, running 6.0.7 under Multifinder.
There are two additional files: regproto.h and tryproto.h, which are the function prototype headers. The source code changes involved the addition of #include statements and the conversion of int types to long types. So far, I have found that trying to port C code originally written for a UNIX machine should have all ints changed to longs, except for stdio character input routines. If Symantec had seen fit to define an int as 32 bits in length,
using UNIX and MPW source code would be much easier.
FILES
Besides the source code files, there is a test file, and various documents. The files are listed below:
regerror.c
regexp.c
regsub.c
regexp.h
regmagic.h
regproto.h (new file)
try.c
tryproto.h (new file)
tests (test data file as input to try)
regexp.3 (original troff manual page)
manpage (nroff version of regexp.3)
README (this file)
timer.c (not ported, but included from original)
timer.t.h (not ported)
As noted above, the timer application was not ported because I was not interested in timing the package, only in using it.
COMPILING THE SOURCE
Build a project that contains regexp.c, regsub.c, try.c, and the ANSI library.
The console feature has been added to the try.c source, so one can execute the UNIX-style command
try <tests
by choosing the 'file' button on the console window and selecting the 'tests' file. In this case, no news (output) is good news. Since the prototype files are available, you may check the compiler option that requires prototypes.
After confirming that the code compiles and executes successfully, you can remove the try.c and ANSI files from the project and add the regerror.c file, and then build a library for future development use.
The original UNIX manual page is provided in both the original raw form and as nroff output. I considered trying to provide the manual page as a Word
document, but it is never clear how many folks have Word, and I do not have MacWrite.
Hopefully all will work as advertised. Good luck and enjoy!